package com.teaphy.coroutinecrawler.flow.operators

import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*

fun main() = runBlocking {
    flowOf(1, 2, 3)
        .onStart { println("Loading ---> start") }
        .onCompletion { println("Loading ---> end") }
        .onEach { println("即将发出的元素是：$it") }
        .collect {
            println("接收到的元素是: $it")
        }

    println("Done")
}